783
315
401692
40954
🥳 Happy to report that the #rstats {equatiomatic} package now supports binomial and poisson regression models from `lme4::glmer()`! Give it a try with the dev version: `remotes::install_github("datalorax/equatiomatic"). pic.twitter.com/ju8ehOUX9E
— Daniel Anderson (@datalorax_) May 18, 2021
#rstats 4.1.0 "Camp Pontanezen" (source version) has been released. pic.twitter.com/Aq0cYlqriL
— Peter Dalgaard (@pdalgd) May 18, 2021
Thanks to @matthewhirschey for a PR to #raymolecule to add support for pulling any molecule from Pubchem with a name/CID!
— Tyler Morgan-Wall (@tylermorganwall) May 18, 2021
Here is "rutin", a citrus flavonoid, and various ways to get it:
get_molecule("rutin")
get_molecule("rutoside")
get_molecule(5280805)#rstats #rayrender pic.twitter.com/dXh7aIu8wz
Sentiment analysis in R {https://t.co/HoyxGDHj7J} #rstats #DataScience
— R-bloggers (@Rbloggers) May 16, 2021
GitHub With R {https://t.co/ZC5n2jnMAO} #rstats #DataScience
— R-bloggers (@Rbloggers) May 16, 2021
Text Analysis with R {https://t.co/Bn4k0cwfhj} #rstats #DataScience
— R-bloggers (@Rbloggers) May 15, 2021
Visualization Graphs-ggside with ggplot {https://t.co/kRY5wVY2VN} #rstats #DataScience
— R-bloggers (@Rbloggers) May 12, 2021
Principal component analysis (PCA) in R {https://t.co/68xX2eIANs} #rstats #DataScience
— R-bloggers (@Rbloggers) May 7, 2021
Linear Discriminant Analysis in R {https://t.co/O9gpvQkXWY} #rstats #DataScience
— R-bloggers (@Rbloggers) May 2, 2021
Timeseries analysis in R {https://t.co/tgIfXXNW8V} #rstats #DataScience
— R-bloggers (@Rbloggers) April 26, 2021
Handling missing values in R {https://t.co/FB4ii7EAl7} #rstats #DataScience
— R-bloggers (@Rbloggers) April 24, 2021
Social Network Analysis in R {https://t.co/xsHQJpERe3} #rstats #DataScience
— R-bloggers (@Rbloggers) April 22, 2021
New Course Available Now: Machine Learning with Tidymodels {https://t.co/9YSDUiWfTs} #rstats #DataScience
— R-bloggers (@Rbloggers) April 20, 2021
Making beautiful maps with ggplot {https://t.co/58mUJ5GWtB} #rstats #DataScience
— R-bloggers (@Rbloggers) April 19, 2021
New features in R 4.1.0 {https://t.co/wmYN0OHixh} #rstats #DataScience
— R-bloggers (@Rbloggers) May 18, 2021
Sentiment analysis in R {https://t.co/HoyxGDHj7J} #rstats #DataScience
— R-bloggers (@Rbloggers) May 16, 2021
Text Analysis with R {https://t.co/Bn4k0cwfhj} #rstats #DataScience
— R-bloggers (@Rbloggers) May 15, 2021
Visualization Graphs-ggside with ggplot {https://t.co/kRY5wVY2VN} #rstats #DataScience
— R-bloggers (@Rbloggers) May 12, 2021
Power analysis in Statistics with R {https://t.co/0Efo5vrjdd} #rstats #DataScience
— R-bloggers (@Rbloggers) May 8, 2021
Linear Discriminant Analysis in R {https://t.co/O9gpvQkXWY} #rstats #DataScience
— R-bloggers (@Rbloggers) May 2, 2021
Timeseries analysis in R {https://t.co/tgIfXXNW8V} #rstats #DataScience
— R-bloggers (@Rbloggers) April 26, 2021
Handling missing values in R {https://t.co/FB4ii7EAl7} #rstats #DataScience
— R-bloggers (@Rbloggers) April 24, 2021
New Course Available Now: Machine Learning with Tidymodels {https://t.co/9YSDUiWfTs} #rstats #DataScience
— R-bloggers (@Rbloggers) April 20, 2021
Making beautiful maps with ggplot {https://t.co/58mUJ5GWtB} #rstats #DataScience
— R-bloggers (@Rbloggers) April 19, 2021
---
title: "#rstats Twitter Explorer"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: scroll
source_code: embed
theme:
version: 4
bootswatch: yeti
css: styles/main.css
---
```{r setup, include=FALSE}
library(flexdashboard)
library(rtweet)
library(dplyr)
library(httr)
library(lubridate)
library(echarts4r)
library(jsonlite)
library(purrr)
get_unique_value <- function(data, col) {
col <- enquo(col)
data %>%
pull(!!col) %>%
unique() %>%
length()
}
rstats_tweets <- read_twitter_csv("data/rstats_tweets.csv")
rbloggers <- fromJSON("data/rbloggers.json")
count_timeseries <- rstats_tweets %>%
ts_data(by = "hours")
tweets_today <- rstats_tweets %>%
filter(created_at == today()-1)
by_hour <- rstats_tweets %>%
group_by(hour = hour(created_at)) %>%
summarise(count = n()) %>%
ungroup()
number_of_unique_tweets <- get_unique_value(rstats_tweets, text)
number_of_unique_tweets_today <- get_unique_value(tweets_today, text)
number_of_tweeters_today <- get_unique_value(tweets_today, user_id)
number_of_likes <- rstats_tweets %>%
pull(favorite_count) %>%
sum()
get_tweet_embed <- function(user, status_id) {
url <- stringr::str_glue("https://publish.twitter.com/oembed?url=https://twitter.com/{user}/status/{status_id}&partner=&hide_thread=false")
response <- GET(url) %>%
content()
return(shiny::HTML(response$html))
}
```
Home
====
Row
-----------------------------------------------------------------------
### Tweets Today
```{r}
valueBox(number_of_unique_tweets_today, icon = "fa-comment-alt", color = "plum")
```
### Tweeters Today
```{r}
valueBox(number_of_tweeters_today, icon = "fa-user", color = "peachpuff")
```
### #rstats Likes
```{r}
valueBox(number_of_likes, icon = "fa-heart", color = "palevioletred")
```
### #rstats Tweets
```{r}
valueBox(number_of_unique_tweets, icon = "fa-comments", color = "mediumorchid")
```
Row {.tabset .tabset-fade data-width=400}
-----------------------------------------------------------------------
### Tweet volume
```{r}
count_timeseries %>%
e_charts(time) %>%
e_line(n, name = "# of tweets", smooth = TRUE) %>%
e_x_axis(
type = "time",
formatter = htmlwidgets::JS(
"function(value){
let date = new Date(value);
label = `${date.getDate()}-${(parseInt(date.getMonth()) + 1)}-${date.getFullYear()}`;
return label;
}"
)
) %>%
e_axis_labels(y = "Tweets") %>%
e_theme("westeros") %>%
e_tooltip(trigger = "axis", formatter = htmlwidgets::JS("
function(params) {
let date = new Date(params[0].value[0])
let options = { year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric'}
let title = `${date.toLocaleDateString('en-US', options=options)}`
let num = `${params[0].value[1]} tweets`
return(`${title}${num}`);
}"))
```
### Tweets by Hour of Day
```{r}
by_hour %>%
e_charts(hour) %>%
e_step(count, name = "Tweets", step = "middle") %>%
e_x_axis(
min = 0,
max = 23,
) %>%
e_axis_labels(x = "Time of Day (UTC)", y = "Tweets") %>%
e_theme("westeros") %>%
e_tooltip(trigger = "axis", formatter = htmlwidgets::JS("
function(params) {
let title = `${params[0].value[0]}h`
let num = `${params[0].value[1]} tweets`
return(`${title}${num}`);
}"))
```
Row
-----------------------------------------------------------------------
### 💗 Most Liked Tweet Today {.tweet-box}
```{r}
most_liked_url <- tweets_today %>%
slice_max(favorite_count)
get_tweet_embed(most_liked_url$screen_name, most_liked_url$status_id)
```
### ✨ Most Retweeted Tweet Today {.tweet-box}
```{r}
most_retweeted <- tweets_today %>%
slice_max(retweet_count)
get_tweet_embed(most_retweeted$screen_name, most_retweeted$status_id)
```
### 🎉 Most Recent {.tweet-box}
```{r}
most_recent <- tweets_today %>%
slice_max(created_at)
get_tweet_embed(most_recent$screen_name[1], most_recent$status_id[1])
```
RBloggers
=========
Row {.tabset .tabset-fade data-height=1000}
-----------------------------------------------------------------------
### Top Tweets by Favourites {.tweet-wall}
```{r}
rblog_by_likes <- rbloggers %>%
top_n(favorite_count, n = 10)
by_likes_html <- map2_chr(rblog_by_likes$screen_name, rblog_by_likes$status_id, get_tweet_embed)
shiny::HTML(stringr::str_glue("{by_likes_html}"))
```
### Top Tweets by Retweets {.tweet-wall}
```{r}
rblog_by_rts <- rbloggers %>%
top_n(retweet_count, n = 10)
by_rts_html <- map2_chr(rblog_by_rts$screen_name, rblog_by_rts$status_id, get_tweet_embed)
shiny::HTML(stringr::str_glue("{by_rts_html}"))
```